import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";
import LoginView from "../views/LoginView.vue";
import administratorsLayer from "../components/administratorsLayer.vue";
import changePasswordLayer from "../components/changePasswordLayer.vue";
import departmentLayer from "../components/departmentLayer.vue";
import doctorLayer from "../components/doctorLayer.vue";
import examinationLayer from "../components/examinationLayer.vue";
import healthLayer from "../components/healthLayer.vue";
import HomeLayer from "../components/homeLayer.vue";
import hospitalLayer from "../components/hospitalLayer.vue";
// import informationLayer from "../components/informationLayer.vue";
import IntroductionLayer from "../components/IntroductionLayer.vue";
import medicalLayer from "../components/medicalLayer.vue";
import messageAnnouncementLayer from "../components/messageAnnouncementLayer.vue";
import navigationLayer from "../components/navigationLayer.vue";
import noticeLayer from "../components/noticeLayer.vue";
import outpatientLayer from "../components/outpatientLayer.vue";
import refundLayer from "../components/refundLayer.vue";
import registerLayer from "../components/registerLayer.vue";
import roleManagementLayer from "../components/roleManagementLayer.vue";
import schedulingLayer from "../components/schedulingLayer.vue";
import testLayer from "../components/testLayer.vue";
import titleManagementLayer from "../components/titleManagementLayer.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "login",
    component: LoginView,
  },
  // 首页
  {
    path: "/",
    name: "home",
    component: HomeView,
    children: [
      { path: "/", component: HomeLayer },
      { path: "/home1", name: "home1", component: HomeLayer },
    ],
  },
  //预约管理
  {
    path: "/appointment",
    name: "appointment",
    component: HomeView,
    children: [
      { path: "/register", name: "register", component: registerLayer },
      { path: "/test", name: "test", component: testLayer },
      { path: "/medical", name: "medical", component: medicalLayer },
      { path: "/scheduling", name: "scheduling", component: schedulingLayer },
    ],
  },
  //费用管理
  {
    path: "/cost",
    name: "cost",
    component: HomeView,

    children: [
      { path: "/outpatient", name: "outpatient", component: outpatientLayer },
      { path: "/hospital", name: "hospital", component: hospitalLayer },
      { path: "/refund", name: "refund", component: refundLayer },
    ],
  },
  //医院信息
  {
    path: "/information",
    name: "information",
    component: HomeView,

    children: [
      { path: "/doctor", name: "doctor", component: doctorLayer },
      { path: "/department", name: "department", component: departmentLayer },
      {
        path: "/examination",
        name: "examination",
        component: examinationLayer,
      },
      { path: "/health", name: "health", component: healthLayer },
      { path: "/navigation", name: "navigation", component: navigationLayer },
      {
        path: "/Introduction",
        name: "Introduction",
        component: IntroductionLayer,
      },
      { path: "/notice", name: "notice", component: noticeLayer },
    ],
  },
  //系统设置
  {
    path: "/systemSettings",
    name: "systemSettings",
    component: HomeView,

    children: [
      {
        path: "/administrators",
        name: "administrators",
        component: administratorsLayer,
      },
      {
        path: "/roleManagement",
        name: "roleManagement",
        component: roleManagementLayer,
      },
      {
        path: "/titleManagement",
        name: "titleManagement",
        component: titleManagementLayer,
      },
      {
        path: "/messageAnnouncement",
        name: "messageAnnouncement",
        component: messageAnnouncementLayer,
      },
      {
        path: "/changePassword",
        name: "changePassword",
        component: changePasswordLayer,
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
